package com.ruoyi.scrb.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.scrb.mapper.ScrbSccMapper;
import com.ruoyi.scrb.domain.ScrbScc;
import com.ruoyi.scrb.service.IScrbSccService;

/**
 * 生产处生产日报录入Service业务层处理
 * 
 * @author wy
 * @date 2022-10-07
 */
@Service
public class ScrbSccServiceImpl implements IScrbSccService 
{
    @Autowired
    private ScrbSccMapper scrbSccMapper;

    /**
     * 查询生产处生产日报录入
     * 
     * @param cDate 生产处生产日报录入主键
     * @return 生产处生产日报录入
     */
    @Override
    public ScrbScc selectScrbSccByCDate(String cDate)
    {
        return scrbSccMapper.selectScrbSccByCDate(cDate);
    }

    /**
     * 查询生产处生产日报录入列表
     * 
     * @param scrbScc 生产处生产日报录入
     * @return 生产处生产日报录入
     */
    @Override
    public List<ScrbScc> selectScrbSccList(ScrbScc scrbScc)
    {
        return scrbSccMapper.selectScrbSccList(scrbScc);
    }

    /**
     * 新增生产处生产日报录入
     * 
     * @param scrbScc 生产处生产日报录入
     * @return 结果
     */
    @Override
    public int insertScrbScc(ScrbScc scrbScc)
    {
        scrbSccMapper.insertScrbScc(scrbScc);
        return scrbSccMapper.updateScrbScc(aa(scrbScc));
    }

    /**
     * 修改生产处生产日报录入
     * 
     * @param scrbScc 生产处生产日报录入
     * @return 结果
     */
    @Override
    public int updateScrbScc(ScrbScc scrbScc)
    {
        scrbSccMapper.updateScrbScc(scrbScc);
        return scrbSccMapper.updateScrbScc(aa(scrbScc));
    }

    private ScrbScc aa(ScrbScc scrbScc) {
        String month = scrbScc.getcDate().substring(0, 7);
        ScrbScc scrbScc1 = scrbSccMapper.selectScrbDrMbLj(month);
        
        String csccClQjLjMb = scrbScc1.getcSccClQjLjMb();
        String csccClYqjLjMb = scrbScc1.getcSccClYqjLjMb();
        String csccClMjyLjMb = scrbScc1.getcSccClMjyLjMb();
        String csccClLsaLjMb = scrbScc1.getcSccClLsaLjMb();
        String csccClQbLjMb = scrbScc1.getcSccClQbLjMb();
        String csccCl1hzyLjMb = scrbScc1.getcSccCl1hzyLjMb();
        String csccCl2hzyLjMb = scrbScc1.getcSccCl2hzyLjMb();
        String csccClBlqtLjMb = scrbScc1.getcSccClBlqtLjMb();
        String csccClQyjLjMb = scrbScc1.getcSccClQyjLjMb();
        String csccClBhLjMb = scrbScc1.getcSccClBhLjMb();
        String csccCl1lzjLjMb = scrbScc1.getcSccCl1lzjLjMb();
        String csccCl2lzjLjMb = scrbScc1.getcSccCl2lzjLjMb();
        String csccCl3lzjLjMb = scrbScc1.getcSccCl3lzjLjMb();
        String csccClPsLjMb = scrbScc1.getcSccClPsLjMb();
        String csccClJqLjMb = scrbScc1.getcSccClJqLjMb();
        String csccClGzLjMb = scrbScc1.getcSccClGzLjMb();
        String csccClQxfLjMb = scrbScc1.getcSccClQxfLjMb();
        String csccClWxLjMb = scrbScc1.getcSccClWxLjMb();
        String csccCl1bLjMb = scrbScc1.getcSccCl1bLjMb();
        String csccCl2bLjMb = scrbScc1.getcSccCl2bLjMb();
        String csccCl1yLjMb = scrbScc1.getcSccCl1yLjMb();
        String csccCl2yLjMb = scrbScc1.getcSccCl2yLjMb();
        String csccClZxLjMb = scrbScc1.getcSccClZxLjMb();
        String csccClZpLjMb = scrbScc1.getcSccClZpLjMb();
        String csccClZkgyLjMb = scrbScc1.getcSccClZkgyLjMb();
        String csccClDzLjMb = scrbScc1.getcSccClDzLjMb();
        String csccClZkzhLjMb = scrbScc1.getcSccClZkzhLjMb();
        String csccClCpLjMb = scrbScc1.getcSccClCpLjMb();
        String csccClGjxLjMb = scrbScc1.getcSccClGjxLjMb();
        String csccClDxxLjMb = scrbScc1.getcSccClDxxLjMb();
        String csccClZqLjMb = scrbScc1.getcSccClZqLjMb();
        String csccClGxjLjMb = scrbScc1.getcSccClGxjLjMb();
        String csccClOxygenLjMb = scrbScc1.getcSccClOxygenLjMb();
        String csccClNitrogenLjMb = scrbScc1.getcSccClNitrogenLjMb();
        String csccClArgonLjMb = scrbScc1.getcSccClArgonLjMb();
        String Zfree1 = scrbScc1.getZfree1();
        String Zfree2 = scrbScc1.getZfree2();
        String Zfree3 = scrbScc1.getZfree3();
        String Zfree4 = scrbScc1.getZfree4();
        String Zfree5 = scrbScc1.getZfree5();
        String Zfree6 = scrbScc1.getZfree6();
        String Zfree7 = scrbScc1.getZfree7();
        String Zfree8 = scrbScc1.getZfree8();
        String Zfree9 = scrbScc1.getZfree9();
        String Zfree10 = scrbScc1.getZfree10();
        String Zfree11 = scrbScc1.getZfree11();
        String Zfree12 = scrbScc1.getZfree12();
        String Zfree13 = scrbScc1.getZfree13();
        String Zfree14 = scrbScc1.getZfree14();
        String Zfree15 = scrbScc1.getZfree15();


        scrbScc.setcSccClQjLjMb(csccClQjLjMb);
        scrbScc.setcSccClYqjLjMb(csccClYqjLjMb);
        scrbScc.setcSccClMjyLjMb(csccClMjyLjMb);
        scrbScc.setcSccClLsaLjMb(csccClLsaLjMb);
        scrbScc.setcSccClQbLjMb(csccClQbLjMb);
        scrbScc.setcSccCl1hzyLjMb(csccCl1hzyLjMb);
        scrbScc.setcSccCl2hzyLjMb(csccCl2hzyLjMb);
        scrbScc.setcSccClBlqtLjMb(csccClBlqtLjMb);
        scrbScc.setcSccClQyjLjMb(csccClQyjLjMb);
        scrbScc.setcSccClBhLjMb(csccClBhLjMb);
        scrbScc.setcSccCl1lzjLjMb(csccCl1lzjLjMb);
        scrbScc.setcSccCl2lzjLjMb(csccCl2lzjLjMb);
        scrbScc.setcSccCl3lzjLjMb(csccCl3lzjLjMb);
        scrbScc.setcSccClPsLjMb(csccClPsLjMb);
        scrbScc.setcSccClJqLjMb(csccClJqLjMb);
        scrbScc.setcSccClGzLjMb(csccClGzLjMb);
        scrbScc.setcSccClQxfLjMb(csccClQxfLjMb);
        scrbScc.setcSccClWxLjMb(csccClWxLjMb);
        scrbScc.setcSccCl1bLjMb(csccCl1bLjMb);
        scrbScc.setcSccCl2bLjMb(csccCl2bLjMb);
        scrbScc.setcSccCl1yLjMb(csccCl1yLjMb);
        scrbScc.setcSccCl2yLjMb(csccCl2yLjMb);
        scrbScc.setcSccClZxLjMb(csccClZxLjMb);
        scrbScc.setcSccClZpLjMb(csccClZpLjMb);
        scrbScc.setcSccClZkgyLjMb(csccClZkgyLjMb);
        scrbScc.setcSccClDzLjMb(csccClDzLjMb);
        scrbScc.setcSccClZkzhLjMb(csccClZkzhLjMb);
        scrbScc.setcSccClCpLjMb(csccClCpLjMb);
        scrbScc.setcSccClGjxLjMb(csccClGjxLjMb);
        scrbScc.setcSccClDxxLjMb(csccClDxxLjMb);
        scrbScc.setcSccClZqLjMb(csccClZqLjMb);
        scrbScc.setcSccClGxjLjMb(csccClGxjLjMb);
        scrbScc.setcSccClOxygenLjMb(csccClOxygenLjMb);
        scrbScc.setcSccClNitrogenLjMb(csccClNitrogenLjMb);
        scrbScc.setcSccClArgonLjMb(csccClArgonLjMb);
        scrbScc.setZfree1(Zfree1);
        scrbScc.setZfree2(Zfree2);
        scrbScc.setZfree3(Zfree3);
        scrbScc.setZfree4(Zfree4);
        scrbScc.setZfree5(Zfree5);
        scrbScc.setZfree6(Zfree6);
        scrbScc.setZfree7(Zfree7);
        scrbScc.setZfree8(Zfree8);
        scrbScc.setZfree9(Zfree9);
        scrbScc.setZfree10(Zfree10);
        scrbScc.setZfree11(Zfree11);
        scrbScc.setZfree12(Zfree12);
        scrbScc.setZfree13(Zfree13);
        scrbScc.setZfree14(Zfree14);
        scrbScc.setZfree15(Zfree15);
        return scrbScc;
    }

    /**
     * 批量删除生产处生产日报录入
     * 
     * @param cDates 需要删除的生产处生产日报录入主键
     * @return 结果
     */
    @Override
    public int deleteScrbSccByCDates(String[] cDates)
    {
        return scrbSccMapper.deleteScrbSccByCDates(cDates);
    }

    /**
     * 删除生产处生产日报录入信息
     * 
     * @param cDate 生产处生产日报录入主键
     * @return 结果
     */
    @Override
    public int deleteScrbSccByCDate(String cDate)
    {
        return scrbSccMapper.deleteScrbSccByCDate(cDate);
    }
}
